<?php defined('SYSPATH') or die('No direct script access.'); ?>
<h3>Payment Options</h3>
<?php if(! empty($errors)):?>
<?php if(Arr::get($errors, 'notinstock')):?>
<div style="background-color: red; color:white; font-size:12px">
<?php echo 'One of the items you are trying to order is out of stock, please go back to your cart and remove the item.';?>
</div>
<?php else:?>
<div style="background-color: red; color:white; font-size:12px">
<?php echo 'There was an error with your payment information.  Please reenter your payment information.';?>
</div>
<?php endif;?>
<?php endif;?>
<?php echo Form::open('cart/placeorder', array('method' => 'post')); ?>

	<?php echo Form::hidden('amount', $total);?>
	
	
	<?php echo form::label('payment_type','Payment Method: '); ?>
	<?php echo form::label('payment_type','Credit Card'); ?>
	<?php echo Form::radio('payment_type', 'CC', true);?>
	<?php echo form::label('payment_type','COD'); ?>
	<?php echo Form::radio('payment_type', 'COD', false);?><br>
	
	<?php echo form::label('ccn','Credit Card Number');?>
	<?php echo Form::input('ccn');?><br>
	<?php echo form::label('svc_code','SVC Number');?>
	<?php echo Form::input('svc_code');?><br><br>
	
	<?php echo Form::label('shipping_method', 'Shipping Type'); ?><br>
	<?php echo Form::radio('shipping_method', 'Overnight') ; ?>
	<?php echo Form::label('shipping_method', 'Overnight'); ?><br>
	<?php echo Form::radio('shipping_method', 'Three Day', TRUE) ; ?>
	<?php echo Form::label('shipping_method', 'Three Day'); ?><br>
	<?php echo Form::radio('shipping_method', 'Five Day') ; ?>
	<?php echo Form::label('shipping_method', 'Five Day'); ?><br>
	
	
	Addresses:<br>
	<?php foreach($address as $place): ?>
		<?php echo Form::label('bill_add', 'Billing'); ?>
		<?php echo Form::radio('bill_add', $place['id']) ; ?>
		<?php echo Form::label('ship_add', 'Shipping'); ?>
		<?php echo Form::radio('ship_add', $place['id']) ; ?><br>
		
		<?php echo Form::label('ship_add', $place['street']
			.' '.$place['city']
			.' '.$place['state']
			.', '.$place['zipcode']);?><br>
			
	

		<br>
	<?php endforeach; ?>	
	<?php echo Form::submit('submit','Place Order');?>
	
<?php echo Form::close(); ?>
<br>
<?php echo Form::open('address/index', array('method' => 'post'));?>
	<?php echo Form::hidden('total', $total);?>
	<?php echo Form::submit('submit','Add an address');?>
<?php echo Form::close();?>
		
